﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="InvoiceFormat.aspx.cs" Inherits="Main_ServiceInvoice_TransactionFormat_InvoiceFormat" %>

<%@ Register Src="~/User Controls/PageHeading.ascx" TagName="heading" TagPrefix="acc" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="AjaxControl" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Invoice Format</title>
    <link href="../../../Styles/accounts.css" rel="stylesheet" type="text/css" />

    <%--<script src="../../../Menu/js/jquery.min.js" type="text/javascript"></script>--%>
<script src="../../../JavaScript/jquery-1.4.2.min.js" type="text/javascript"></script>
    <link href="../../../Styles/HorizontalTab.css" rel="stylesheet" type="text/css" />

    <script src="../../../JavaScript/HorizontalTab.js" type="text/javascript"></script>

    <script type="text/javascript">
         function isNumberKey(control_id, evt) {
             var charCode = (evt.which) ? evt.which : event.keyCode
             if (charCode > 31 && (charCode < 48 || charCode > 57) && (charCode < 45 || charCode >= 47))
                 return false;

             if (charCode == 46) {
                 var dotcount = document.getElementById(control_id).value.split('.').length - 1;
                 if (dotcount >= 1) {
                     return false;
                 }
             }
             return true;
         }
         function EnabledTabKey(id, e) {
             var keycode;
             if (window.event) {
                 keycode = window.event.keyCode;
             }
             else if (e) {
                 keycode = e.which;
             }
             else {
                 return true;
             }
             if (keycode == 9) {
                 // if is the tab key                
                 return true;
             }
             else {
                 return false;
             }
         }
         function RequiredField() {
             var Flag = true;
             if (document.getElementById("txtFormatName").value == '') {
                 alert('Specify Invoice Format Name');
                 document.getElementById("txtFormatName").focus();
                 Flag = false;
             }
             var isvalid = blanknotallow();
             if (Flag == true && isvalid == true) {
                 return true;
             }
             else {
                 return false;
             }
         }
       
         function FillZero(id) {
             var ctrlValue = document.getElementById(id).value;
             var zero = 0;
             if (ctrlValue == '') {
                 document.getElementById(id).value = parseFloat(zero).toFixed(2);
             }
             else {
                 document.getElementById(id).value = parseFloat(ctrlValue).toFixed(2);
             }
             return true;
         }
         function ServiceTaxSettingTaxAtItemLevel(id) {
             var radioButtonTax = document.getElementById(id);
             var radioButtonDiscount = document.getElementById("rbtApplyDiscount");
             var InputsTax = radioButtonTax.getElementsByTagName("input");
             var InputsDiscount = radioButtonDiscount.getElementsByTagName("input");
             for (var i = 0; i < InputsTax.length; i++) {
                 if (InputsTax[i].checked) {
                     if (InputsTax[i].value == '1') {
                         document.getElementById("panelAdditionalTax").style.display = "none"; ;
                         document.getElementById("panelServiceTax").style.display = "inline";
                         if (InputsDiscount[1].checked == true) {
                             InputsDiscount[0].checked = true;
                         }
                         InputsDiscount[1].disabled = true;                        
                     }
                     else {
                         document.getElementById("panelServiceTax").style.display = "none"; ;
                         document.getElementById("panelAdditionalTax").style.display = "inline";                         
                         InputsDiscount[1].disabled = false; 
                     }
                 }                
             }
         }
         function EnablePostBillingTab() {
             var chk = document.getElementById("chkPostBillingTDS");
             if (chk.checked == true) {
                 document.getElementById("hyperPostBilling").disabled = false;
             }
             else {
                 document.getElementById("hyperPostBilling").disabled = true;
             }
         }

         function PageSettings() {
             var chk = document.getElementById("chkPageSettings");

             if (chk.checked == true) {

                 document.getElementById("txtHeaderMargin").value = "0.5";
                 document.getElementById("txtHeaderMargin").disabled = true;                
                 document.getElementById("txtFooterMargin").value = "0.5";
                 document.getElementById("txtFooterMargin").disabled = true;
             }
             else {
                 document.getElementById("txtHeaderMargin").value = "";
                 document.getElementById("txtHeaderMargin").disabled = false;
                 document.getElementById("txtFooterMargin").value = "";
                 document.getElementById("txtFooterMargin").disabled = false;
             }
         }
         
         function EnableTextboxoncheck() {
             var chk = document.getElementById("chkBillCaption");
             var chkbeforedetail = document.getElementById("chkInfoBeforeDetails");
             var chkNote = document.getElementById("chkNote");
             
             if (chk.checked == true) {

                 document.getElementById("txtBillCaption").disabled = false;
             }
             else {
                 document.getElementById("txtBillCaption").disabled = true;
             }

             if (chkbeforedetail.checked == true) {

                 document.getElementById("txtInfoBeforeDetails").disabled = false;
             }
             else {
                 document.getElementById("txtInfoBeforeDetails").disabled = true;
             }

             if (chkNote.checked == true) {

                 document.getElementById("txtNote").disabled = false;
             }
             else {
                 document.getElementById("txtNote").disabled = true;
             }
         }

         function blanknotallow() {
           
             if (document.getElementById("txtBillCaption").disabled == false && document.getElementById("txtBillCaption").value == "") {
                 alert("Bill Caption cannot be blank!");
                 document.getElementById("txtBillCaption").focus();
                 return false;
             }

             if (document.getElementById("txtInfoBeforeDetails").disabled == false && document.getElementById("txtInfoBeforeDetails").value == "") {
                 alert("Information Before Details cannot be blank!");
                 document.getElementById("txtInfoBeforeDetails").focus();
                 return false;
             }

             if (document.getElementById("txtNote").disabled == false && document.getElementById("txtNote").value == "") {
                 alert("Note cannot be blank!");
                 document.getElementById("txtNote").focus();
                 Flag = false;
                 return false;
             }
             return true;
         }
         
         function CalculateTdsRate() {
             var TDSRate = document.getElementById("txtPostBillTDS").value;
             var Surcharge = document.getElementById("txtPostBillSurcharge").value;
             var Cess = document.getElementById("txtPostBillCess").value;
             if (TDSRate == '') {
                 TDSRate = 0;
             }
             if (Surcharge == '') {
                 Surcharge = 0;
             }
             if (Cess == '') {
                 Cess = 0;
             }
             if (parseFloat(Surcharge) > 100) {
                 alert('Surcharge Rate can not more Than 100');
                 document.getElementById("txtPostBillSurcharge").value = '0.00';
                 document.getElementById("txtPostBillSurcharge").focus();
             }
             else if (parseFloat(Cess) > 100) {
                 alert('Cess Rate can not more Than 100');
                 document.getElementById("txtPostBillCess").value = '0.00';
                 document.getElementById("txtPostBillCess").focus();
             }
             else if (parseFloat(TDSRate) > 0 && parseFloat(TDSRate) <= 100) {
                 var surRate = (parseFloat(TDSRate) * parseFloat(Surcharge)) / 100;
                 var cessRate = ((parseFloat(TDSRate) + parseFloat(surRate)) * parseFloat(Cess)) / 100;
                 var EffectiveRate = parseFloat(TDSRate) + parseFloat(surRate) + parseFloat(cessRate);
                 document.getElementById("txtPostBillEffectiveRate").value = parseFloat(EffectiveRate).toFixed(2);
             }
             else if (parseFloat(TDSRate) > 100) {
                 alert('TDS Rate can not more Than 100');
                 document.getElementById("txtPostBillTDS").value = '0.00';
                 document.getElementById("txtPostBillTDS").focus();
             }
             return true;
         }

         function AdvancedUnitFormula() {
             var chkUnit2 = document.getElementById("chkAdvancedUnitUnit2");
             var chkUnit3 = document.getElementById("chkAdvancedUnitUnit3");
             var chkUnit4 = document.getElementById("chkAdvancedUnitUnit4");
             var txtUnit2 = document.getElementById("txtAdvancedUnitUnit2").value;
             var txtUnit3 = document.getElementById("txtAdvancedUnitUnit3").value;
             var txtUnit4 = document.getElementById("txtAdvancedUnitUnit4").value;
             var strFormual = '';
             if (chkUnit2.checked == true) {
                 strFormual = txtUnit2;
                 document.getElementById("txtAdvancedUnitAdditionalCap").value = txtUnit2;
                 document.getElementById("txtAdvancedUnitGrossAmt").value = ' RESULT1 X  Rate';
             }
             else if (chkUnit3.checked == true) {
                 strFormual = txtUnit3;
                 document.getElementById("txtAdvancedUnitAdditionalCap").value = txtUnit3;
                 document.getElementById("txtAdvancedUnitGrossAmt").value = ' RESULT1 X  Rate';
             }
             else if (chkUnit4.checked == true) {
                 strFormual = txtUnit4;
                 document.getElementById("txtAdvancedUnitAdditionalCap").value = txtUnit4;
                 document.getElementById("txtAdvancedUnitGrossAmt").value = ' RESULT1 X  Rate';
             }
             else {
                 document.getElementById("txtAdvancedUnitAdditionalCap").value = '';
                 document.getElementById("txtAdvancedUnitGrossAmt").value = '';
             } 
             if (chkUnit2.checked == true && chkUnit3.checked == true) {
                 strFormual = txtUnit2 + ' X ' + txtUnit3;
                 document.getElementById("txtAdvancedUnitAdditionalCap").value = 'Area';
                 document.getElementById("txtAdvancedUnitGrossAmt").value = ' RESULT1 X  Rate';
             }
             if (chkUnit2.checked == true && chkUnit4.checked == true) {
                 strFormual= txtUnit2 + ' X ' + txtUnit4;
                 document.getElementById("txtAdvancedUnitAdditionalCap").value = 'Area';
                 document.getElementById("txtAdvancedUnitGrossAmt").value = ' RESULT1 X  Rate';
             }
             if (chkUnit3.checked == true && chkUnit4.checked == true) {
                 strFormual = txtUnit3 + ' X ' + txtUnit4;
                 document.getElementById("txtAdvancedUnitAdditionalCap").value = 'Area';
                 document.getElementById("txtAdvancedUnitGrossAmt").value = ' RESULT1 X  Rate';
             }
             if (chkUnit2.checked == true && chkUnit3.checked == true && chkUnit4.checked == true) {
                 strFormual = txtUnit2 + ' X ' + txtUnit3 + ' X ' + txtUnit4;
                 document.getElementById("txtAdvancedUnitAdditionalCap").value = 'Volume';
                 document.getElementById("txtAdvancedUnitGrossAmt").value = ' RESULT1 X  Rate';
             }
             document.getElementById("txtAdvancedUnitCalculationUnit").value = strFormual;
         }
         function ValidateAdvancedUnit() {
             var flag = true;
             var txtUnit2 = document.getElementById("txtAdvancedUnitUnit2").value;
             var txtUnit3 = document.getElementById("txtAdvancedUnitUnit3").value;
             var txtUnit4 = document.getElementById("txtAdvancedUnitUnit4").value;
             if (txtUnit2 == '') {
                 flag = false;
                 alert('Specify Unit 2');
                 document.getElementById("txtAdvancedUnitUnit2").focus();
             }
             else if (txtUnit3 == '') {
                 flag = false;
                 alert('Specify Unit 3');
                 document.getElementById("txtAdvancedUnitUnit3").focus();
             }
             else if (txtUnit4 == '') {
                 flag = false;
                 alert('Specify Unit 4');
                 document.getElementById("txtAdvancedUnitUnit4").focus();
             }
             return flag;
         }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div class="divmain">
        <acc:heading ID="header1" runat="server" HeadingText="Invoice Format" />
    </div>
    <div style="width: 90%; margin-left: 5%; margin-right: 5%; text-align: center">
        <asp:Label ID="lblMsg" runat="server" Font-Bold="true"></asp:Label>
    </div>
    <asp:Panel ID="PnlAddNew" runat="server" Visible="false">
        <div style="width: 90%; margin-left: 5%; margin-right: 5%" class="tablecontent">
            <%-- <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>--%>
            <asp:HiddenField ID="hidFormatId" runat="server" Value="0" />
            <asp:HiddenField ID="hidTypeId" runat="server" Value="-1" />
            <table style="width: 100%">
                <tr>
                    <td class="headtd" colspan="3">
                        Invoice Format
                    </td>
                </tr>
                <tr>
                    <td style="width: 25%">
                        Format Name<span style="color: Red">*</span>
                    </td>
                    <td style="width: 30%">
                        <asp:TextBox ID="txtFormatName" MaxLength="50" ToolTip="Format Name" runat="server"
                            Width="180px" CssClass="input"></asp:TextBox>
                    </td>
                    <td style="width: 45%">
                        <asp:CheckBox ID="chkDefualt" runat="server" Text="Set as Default" />
                    </td>
                </tr>
            </table>
            <%--     </ContentTemplate>
        </asp:UpdatePanel>--%>
        </div>
        <div id="wrapper">
            <ul class="tabs">
                <li><a href="javascript:void(0)" class="defaulttab" rel="tabOptions">Options</a></li>
                <li><a href="javascript:void(0)" rel="tabTaxDiscount">Tax/Discount</a></li>
                <li><a href="javascript:void(0)" rel="tabNumberSettings">Number Settings</a></li>
                <li><a href="javascript:void(0)" rel="tabCaptions">Captions</a></li>
                <li><a href="javascript:void(0)" id="hyperPostBilling" runat="server" rel="tabPostBilling">
                    Post Billing</a></li>
                <li><a href="javascript:void(0)" rel="tabAdvancedUnit">Advanced Unit</a></li>
                <li><a href="javascript:void(0)" rel="tabReports">Reports</a></li>
            </ul>
            <div class="tab-content" id="tabOptions" runat="server">
                <div style="margin-left: 10px;">
                    <table cellpadding="2" cellspacing="2">
                        <tr>
                            <td>
                                <asp:CheckBox ID="chkUnitRate" runat="server" Text="Unit & Rate" Checked="True" Enabled="False" />
                            </td>
                            <td>
                                <asp:CheckBox ID="chkReferenceNumber" runat="server" Text="Reference Number" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:CheckBox ID="chkUOM" runat="server" Text="Unit of Measurement" />
                            </td>
                            <td>
                                <asp:CheckBox ID="chkCheckedBy" runat="server" Text="Checked By" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:CheckBox ID="chkAmtInclusiveTax" runat="server" Text="Amount Inclusive of Tax" />
                            </td>
                            <td>
                                <asp:CheckBox ID="chkNarration" runat="server" Text="Narration" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:CheckBox ID="chkShowNonTaxableAmt" runat="server" Text="Show Non Taxable Amount" />
                            </td>
                            <td>
                                <asp:CheckBox ID="chkPreparedBy" runat="server" Text="Prepared By" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:CheckBox ID="chkShowServiceCharges" runat="server" Text="Show Service Charges" />
                            </td>
                            <td>
                                <asp:CheckBox ID="chkPrinOnSave" runat="server" Text="Print On Save" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:CheckBox ID="chkAddDescription" runat="server" Text="Additional Description for Service" />
                            </td>
                            <td>
                                <asp:CheckBox ID="chkRemarks" runat="server" Text="Remarks" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:CheckBox ID="chkPostBillingTDS" runat="server" onclick="EnablePostBillingTab();"
                                    Text="Post Billing for TDS" />
                            </td>
                            <td>
                                <asp:CheckBox ID="chkYearReference" runat="server" Text="Yearly Reference for Service" />
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <asp:CheckBox ID="chkServicedBy" runat="server" Text="Serviced By" />
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
            <div id="tabTaxDiscount" class="tab-content">
                <div style="margin-left: 10px;">
                    <table width="90%">
                        <tr>
                            <td valign="top" style="width: 50%">
                                <table width="100%" style="margin-bottom: 5px" class="tablecontent">
                                    <tr>
                                        <td class="headtd">
                                            Apply Discount
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:RadioButtonList ID="rbtApplyDiscount" runat="server" RepeatDirection="Horizontal">
                                                <asp:ListItem Text="None" Value="0" Selected="True"></asp:ListItem>
                                                <asp:ListItem Text="Bill Level" Value="1"></asp:ListItem>
                                                <asp:ListItem Text="Item Level" Value="2"></asp:ListItem>
                                            </asp:RadioButtonList>
                                        </td>
                                    </tr>
                                </table>
                                <table width="100%" class="tablecontent">
                                    <tr>
                                        <td class="headtd">
                                            Apply Tax
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:RadioButtonList ID="rbtApplyTax" runat="server" RepeatDirection="Horizontal"
                                                onclick="ServiceTaxSettingTaxAtItemLevel(this.id);">
                                                <asp:ListItem Text="Bill Level" Value="0" Selected="True"></asp:ListItem>
                                                <asp:ListItem Text="Item Level" Value="1"></asp:ListItem>
                                            </asp:RadioButtonList>
                                        </td>
                                    </tr>
                                </table>
                                <br />
                                <b>Tax Settings:</b>
                                <br />
                                <asp:Panel ID="panelAdditionalTax" runat="server">
                                    Additional Tax &nbsp;&nbsp:<asp:DropDownList ID="ddlAdditionalTax" runat="server"
                                        CssClass="dropdown">
                                    </asp:DropDownList>
                                </asp:Panel>
                                <asp:Panel ID="panelServiceTax" runat="server" Style="display: none;">
                                    <asp:RadioButtonList ID="rbtServiceTaxSettings" runat="server" RepeatDirection="Vertical">
                                        <asp:ListItem Text="Service Tax" Value="0" Selected="True"></asp:ListItem>
                                        <asp:ListItem Text="Service Tax, Luxury Tax" Value="1"></asp:ListItem>
                                        <asp:ListItem Text="Service Tax, VAT" Value="2"></asp:ListItem>
                                    </asp:RadioButtonList>
                                </asp:Panel>
                            </td>
                            <td valign="top" style="width: 15px">
                                &nbsp;
                            </td>
                            <td valign="top" style="width: 45%">
                                <table width="100%" class="tablecontent">
                                    <tr>
                                        <td colspan="2" class="headtd">
                                            <b>Default Head of Accounts:</b>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Round Off
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="ddlRoundOff" runat="server" Width="140px" CssClass="dropdown">
                                            </asp:DropDownList>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Discount
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="ddlDiscount" runat="server" Width="140px" CssClass="dropdown">
                                            </asp:DropDownList>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
            <div class="tab-content" id="tabNumberSettings" runat="server">
                <div style="margin-left: 10px;">
                    <table style="width: 100%">
                        <tr>
                            <td>
                                Type
                            </td>
                            <td>
                                Prefix
                            </td>
                            <td>
                                Starting No
                            </td>
                            <td>
                                Suffix
                            </td>
                            <td>
                                Width of The No.
                            </td>
                            <td>
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:DropDownList ID="ddlType" runat="server" CssClass="dropdown">
                                    <asp:ListItem Value="0" Text="Manual"></asp:ListItem>
                                    <asp:ListItem Value="1" Text="Automatic" Selected="True"></asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td>
                                <asp:TextBox ID="txtPrefix" MaxLength="10" runat="server" Width="80px" CssClass="input"></asp:TextBox>
                            </td>
                            <td>
                                <asp:TextBox ID="txtStartNo" runat="server" Width="80px" CssClass="input" Text="1"
                                    MaxLength="6" onKeyPress="return isNumberKey(this.id,event)" Style="text-align: right"></asp:TextBox>
                            </td>
                            <td>
                                <asp:TextBox ID="txtSuffix" MaxLength="10" runat="server" Width="80px" CssClass="input"></asp:TextBox>
                            </td>
                            <td>
                                <asp:TextBox ID="txtWidthofNo" runat="server" Width="80px" CssClass="input" MaxLength="1"
                                    onKeyPress="return isNumberKey(this.id,event)" Style="text-align: right"></asp:TextBox>
                            </td>
                            <td>
                                <asp:CheckBox ID="chkResetYear" runat="server" Text="Reset Every Year" />
                            </td>
                        </tr>
                        <tr>
                            <td colspan="6">
                                &nbsp;
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
            <div class="tab-content" id="tabCaptions" runat="server">
                <div style="margin-left: 10px;">
                    <table cellpadding="2" cellspacing="0">
                        <tr>
                            <td>
                                Unit
                            </td>
                            <td>
                                <asp:TextBox ID="txtCaptionUnit" MaxLength="50" runat="server" CssClass="input"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Rate
                            </td>
                            <td>
                                <asp:TextBox ID="txtCaptionRate" MaxLength="50" runat="server" CssClass="input"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Year Reference
                            </td>
                            <td>
                                <asp:TextBox ID="txtCaptionYearRef" MaxLength="50" runat="server" CssClass="input"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Additional Description
                            </td>
                            <td>
                                <asp:TextBox ID="txtCaptionAddDesc" MaxLength="50" runat="server" CssClass="input"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Unit of Measurement
                            </td>
                            <td>
                                <asp:TextBox ID="txtCaptionUOM" MaxLength="50" runat="server" CssClass="input"></asp:TextBox>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
            <div class="tab-content" id="tabPostBilling" runat="server">
                <div style="margin-left: 10px;">
                    <table cellpadding="2" cellspacing="0" width="100%">
                        <tr>
                            <td colspan="4" style="width: 100%;">
                                <div style="float: left;">
                                    Deduct TDS on &nbsp;&nbsp;
                                </div>
                                <div style="float: left; vertical-align: top;">
                                    <asp:RadioButtonList ID="rbtPostBillDeductTDS" runat="server" RepeatDirection="Horizontal">
                                        <asp:ListItem Text="Amount Exclusive ST and Cess" Value="0" Selected="True"></asp:ListItem>
                                        <asp:ListItem Text="Amount Inclusive ST and Cess" Value="1"></asp:ListItem>
                                    </asp:RadioButtonList>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 20%">
                                TDS %
                            </td>
                            <td style="width: 20%">
                                Surcharge %
                            </td>
                            <td style="width: 20%">
                                Cess %
                            </td>
                            <td style="width: 40%">
                                Effective Rate %
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:TextBox ID="txtPostBillTDS" MaxLength="10" runat="server" Width="100px" onblur="return CalculateTdsRate();"
                                    onkeypress="return isNumberKey(this.id,event);" CssClass="inputnumber"></asp:TextBox>
                            </td>
                            <td>
                                <asp:TextBox ID="txtPostBillSurcharge" MaxLength="10" runat="server" Width="100px"
                                    onblur="return CalculateTdsRate();" onkeypress="return isNumberKey(this.id,event);"
                                    CssClass="inputnumber"></asp:TextBox>
                            </td>
                            <td>
                                <asp:TextBox ID="txtPostBillCess" MaxLength="21" runat="server" Width="100px" onblur="return CalculateTdsRate();"
                                    onkeypress="return isNumberKey(this.id,event);" CssClass="inputnumber"></asp:TextBox>
                            </td>
                            <td>
                                <asp:TextBox ID="txtPostBillEffectiveRate" MaxLength="10" runat="server" Width="100px"
                                    onkeypress="return isNumberKey(this.id,event);" onkeydown="return EnabledTabKey(this.id,event);"
                                    CssClass="inputnumber"></asp:TextBox>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
            <div class="tab-content" id="tabAdvancedUnit" runat="server">
                <div style="margin-left: 10px;">
                    <b>Additional Columns</b>
                    <br />
                    <table cellpadding="2" width="100%">
                        <tr>
                            <td>
                                Additional Unit Caption
                            </td>
                            <td>
                                <asp:TextBox ID="txtAdvancedUnitAdditionalCap" MaxLength="50" runat="server" CssClass="input"></asp:TextBox>
                            </td>
                            <td>
                                <asp:CheckBox ID="chkAdvancedUnitUnit2" runat="server" onclick="AdvancedUnitFormula();" />
                                <asp:TextBox ID="txtAdvancedUnitUnit2" MaxLength="50" runat="server" Width="100px"
                                    Text="Unit2" onkeyup="AdvancedUnitFormula();" CssClass="input"></asp:TextBox>
                            </td>
                            <td>
                                <asp:CheckBox ID="chkAdvancedUnitUnit3" runat="server" onclick="AdvancedUnitFormula();" />
                                <asp:TextBox ID="txtAdvancedUnitUnit3" MaxLength="50" runat="server" Width="100px"
                                    Text="Unit3" onkeyup="AdvancedUnitFormula();" CssClass="input"></asp:TextBox>
                            </td>
                            <td>
                                <asp:CheckBox ID="chkAdvancedUnitUnit4" runat="server" onclick="AdvancedUnitFormula();" />
                                <asp:TextBox ID="txtAdvancedUnitUnit4" MaxLength="50" runat="server" Width="100px"
                                    Text="Unit4" onkeyup="AdvancedUnitFormula();" CssClass="input"></asp:TextBox>
                            </td>
                        </tr>
                    </table>
                    <table width="100%">
                        <tr>
                            <td valign="top" style="width: 45%;">
                                <table width="100%" class="tablecontent">
                                    <tr>
                                        <td style="width: 100%" colspan="2" class="headtd">
                                            Calculation of Unit2,Unit3,Unit4 (Result1)
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2" style="width: 100%">
                                            <asp:TextBox ID="txtAdvancedUnitCalculationUnit" MaxLength="250" runat="server" Width="98%"
                                                TextMode="MultiLine" CssClass="input" Height="60px"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Sample: Unit2 X Unit3 X Unit4
                                        </td>
                                        <td>
                                            <asp:Button ID="btnAdvanceUnitValidateUnit" runat="server" Text="Validate" OnClientClick="return ValidateAdvancedUnit();"
                                                CssClass="button1" />
                                        </td>
                                    </tr>
                                </table>
                            </td>
                            <td style="width: 10px" valign="top">
                                &nbsp;
                            </td>
                            <td valign="top" style="width: 45%;">
                                <table width="100%" class="tablecontent">
                                    <tr>
                                        <td style="width: 100%" colspan="2" class="headtd">
                                            Calculation of Gross Amount
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2" style="width: 100%">
                                            <asp:TextBox ID="txtAdvancedUnitGrossAmt" MaxLength="250" runat="server" Width="98%"
                                                TextMode="MultiLine" CssClass="input" Height="60px"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Sample: Unit X Rate X Result1
                                        </td>
                                        <td>
                                            <asp:Button ID="btnAdvancedUnitValidateGrossAmt" runat="server" Text="Validate" CssClass="button1" />
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
            <div class="tab-content" id="tabReports" runat="server">
                <div style="margin-left: 10px;">
                    <table width="100%">
                        <tr>
                            <td valign="top" style="width: 40%">
                                <table width="100%">
                                    <tr>
                                        <td style="width: 100%">
                                            <asp:CheckBox ID="chkBillCaption" runat="server" onclick="return EnableTextboxoncheck();"
                                                Text="Bill Caption" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:TextBox ID="txtBillCaption" Enabled="false" MaxLength="250" runat="server" onblur="return blanknotallow();"
                                                CssClass="input"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Firm Caption
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:TextBox ID="txtFirmCaption" MaxLength="255" runat="server" CssClass="input"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:CheckBox ID="chkInfoBeforeDetails" onclick="return EnableTextboxoncheck();"
                                                runat="server" Text="Information Before Details" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:TextBox ID="txtInfoBeforeDetails" Enabled="false" MaxLength="250" onblur="return blanknotallow();"
                                                runat="server" CssClass="input"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:CheckBox ID="chkNote" onclick="return EnableTextboxoncheck();" runat="server"
                                                Text="Note" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:TextBox ID="txtNote" Enabled="false" runat="server" onblur="return blanknotallow();"
                                                MaxLength="250" CssClass="input"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="padding-top: 7px">
                                            <asp:CheckBox ID="chkPrintLogo" runat="server" Text="Print Logo" />
                                        </td>
                                    </tr>
                                    <%-- <tr>
                                <td>
                                     <asp:HiddenField ID="hidFileUpload" runat="server" />
                                   <asp:FileUpload ID="fileUploadLogo" runat="server" ToolTip="Upload Logo" />
                                </td>
                            </tr>--%>
                                </table>
                            </td>
                            <td valign="top" style="width: 60%">
                                <table class="tablecontent" width="100%">
                                    <tr>
                                        <td colspan="4" class="headtd" style="width: 100%">
                                            <asp:CheckBox ID="chkPageSettings" onclick="return PageSettings();" runat="server"
                                                Text="Page Settings" />&nbsp;&nbsp;&nbsp;(Default 0.5F)
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Header Margin
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtHeaderMargin" runat="server" MaxLength="5" Text="0.50" onkeypress="return isNumberKey(this.id,event);"
                                                onblur="return FillZero(this.id); " CssClass="inputnumber"></asp:TextBox>
                                        </td>
                                        <td>
                                            Footer Margin
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtFooterMargin" runat="server" MaxLength="5" Text="0.50" onkeypress="return isNumberKey(this.id,event);"
                                                onblur="return FillZero(this.id); " CssClass="inputnumber"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Paper Size
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="ddlPaperSize" runat="server" CssClass="dropdown">
                                                <asp:ListItem Text="A4- One Bill Per Page" Value="0"></asp:ListItem>
                                                <asp:ListItem Text="A4- Two Bills per Page" Value="1"></asp:ListItem>
                                            </asp:DropDownList>
                                        </td>
                                        <td>
                                            No. of Copies
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtNoOfCopy" MaxLength="3" runat="server" Text="1" onkeypress="return isNumberKey(this.id,event);"
                                                CssClass="inputnumber"></asp:TextBox>
                                        </td>
                                    </tr>
                                </table>
                                <table class="tablecontent" width="100%" style="margin-top: 5px">
                                    <tr>
                                        <td style="width: 50%">
                                            <asp:CheckBox ID="chkReportFirmNameAddress" runat="server" Text="Firm Name and Address" />
                                        </td>
                                        <td style="width: 50%">
                                            <asp:CheckBox ID="chkReportPreparedBy" runat="server" Text="Prepared By" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:CheckBox ID="chkReportPAN" runat="server" Text="PAN" />
                                        </td>
                                        <td>
                                            <asp:CheckBox ID="chkReportCheckedBy" runat="server" Text="Checked By" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:CheckBox ID="chkReportSTRegNo" runat="server" Text="ST Reg. No." />
                                        </td>
                                        <td>
                                            <asp:CheckBox ID="chkReportServicedBy" runat="server" Text="Serviced By" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:CheckBox ID="chkReportOutStandingSummary" runat="server" Text="Out Standing Summary" />
                                        </td>
                                        <td>
                                            <asp:CheckBox ID="chkReportReferenceNo" runat="server" Text="Reference Number" />
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>
        <div style="width: 90%; margin-left: 5%; margin-right: 5%; text-align: center">
            <asp:Button ID="btnSave" runat="server" Text="Save" CssClass="button" OnClientClick="return RequiredField();"
                OnClick="btnSave_OnClick" />&nbsp;
            <asp:Button ID="btnCancel" runat="server" Text="Cancel" CssClass="button" OnClick="btnCancel_OnClick" />
        </div>
    </asp:Panel>
    <asp:Panel ID="PnlView" runat="server" Visible="false">
        <div style="width: 90%; margin-left: 5%; margin-right: 5%; margin-top: 15px;">
            <asp:GridView ID="grdDisplay" runat="server" CssClass="gridview" Width="100%" DataKeyNames="FormatId"
                AlternatingRowStyle-CssClass="gridview_alternate" OnRowDataBound="grdDisplay_OnRowDataBound"
                OnSelectedIndexChanged="grdDidplay_OnSelectedIndexChanged" AutoGenerateColumns="false">
                <Columns>
                    <asp:TemplateField HeaderText="S.No." ItemStyle-HorizontalAlign="Center">
                        <ItemTemplate>
                            <%#Container.DataItemIndex+1 %>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField HeaderText="Format Name" DataField="FORMATNAME" ItemStyle-HorizontalAlign="Left" />
                    <asp:BoundField HeaderText="Default" DataField="SETASDEFAULT" ItemStyle-HorizontalAlign="Center" />
                    <asp:BoundField HeaderText="Checked By" DataField="CHECKEDBY" ItemStyle-HorizontalAlign="Center" />
                    <asp:BoundField HeaderText="Prepared By" DataField="PREPAREDBY" ItemStyle-HorizontalAlign="Center" />
                    <asp:BoundField HeaderText="Ref. No." DataField="REFERENCENUMBER" ItemStyle-HorizontalAlign="Center" />
                    <asp:BoundField HeaderText="Remarks" DataField="REMARKS" ItemStyle-HorizontalAlign="Center" />
                    <asp:BoundField HeaderText="Narration" DataField="NARRATION" ItemStyle-HorizontalAlign="Center" />
                    <asp:BoundField HeaderText="Print On Save" DataField="PRINTONSAVE" ItemStyle-HorizontalAlign="Center" />
                    <asp:CommandField ShowSelectButton="true" ItemStyle-HorizontalAlign="Center" HeaderText="Edit"
                        ButtonType="Image" SelectImageUrl="~/Menu/images/Edit_user.png" />
                </Columns>
            </asp:GridView>
        </div>
    </asp:Panel>
    </form>
</body>
</html>
